<div style="text-align:center;" class="goods_track">
    <h1>货物追踪</h1>
    <table>
        <tr>
            <td>
                <{input type="text" name="express_no" id="express_no"}>
            </td>
        </tr>
    </table>
    <label for="in_vcode">验证码：</label>
    <span id='trackVerifyCodebox_<{$widgets_id}>'>
        <{input style='width:40px;padding:0px;' class="inputstyle"  type="digits" required="true" name="trackCode"  tabindex="3" id="trackCode"}>
        <span class='verifyCode' style='display:none;'>
            <img src="#" border="1" id="trackVerifyCode_<{$widgets_id}>"/><br />
            <a href="javascript:changeimg_<{$widgets_id}>()">看不清楚?换个图片</a>
        </span>
   </span>
   <br />
   <input type="button" name="btn_query" id="btn_query" value="追踪" />
</div>

<div style="border: 7px solid rgb(93, 111, 139); position: absolute; z-index: 65535; width: 700px; height:500px;font-family: Georgia,&quot;Times New Roman&quot;,Times,serif ! important; opacity: 1;visibility:hidden;" class="mini-shop-cart division boxGray" id="express_dialog">
	<table border="0" cellpadding="0" cellspacing="0" class='liststyle' style='background:#fff'>
		<thead>
			<tr>
				<th width='95%' style='text-align:left' class='title'>
					<{img  src="statics/bundle/arrow-down.gif"}>货物追踪
				</th>
				<th>&nbsp;&nbsp;<span onmouseover="this.style.color='#cc0000'" onmouseout="this.style.color='#666666'" class='close' style="font-size:14px; font-weight:bold; font-family:Verdana, Arial, Helvetica, sans-serif; color:#666666; cursor:pointer;">X</span>&nbsp;&nbsp;
				</th>
			</tr>
		</thead>
	</table>
	<div id="exp_query_result" class="division"></div>
	<img src="images/resize-btn.gif" class="dialog-btn-resize" style="bottom:1px;cursor:nw-resize;position:absolute;right:1px;width;auto;height:auto;">
</div>

<script>
    window.addEvent('domready', function(){
		var _win=window.ie?$(document.body):window;
		var btn_query = $('btn_query');
		var exp_dlg_el = $('express_dialog');
		var _winSize=window.getSize().size;
		var exp_dlg_close = exp_dlg_el.getElements('.close');

		var dlgAmong=function(){
			exp_dlg_el.amongTo(window);
		};
		exp_dlg_close.addEvent('click',function(){
			exp_dlg_el.setStyle('visibility','hidden');
		});

		exp_dlg_el.makeResizable({
			handle:exp_dlg_el.getElement('.dialog-btn-resize'),
			limit: {x: [350, 1024], y: [500, 800]}
		});

		btn_query.addEvent('click',function(){
            var expressNo = $('express_no').value.trim();
            var trackCode = $('trackCode').value.trim();
			if (!expressNo){
				alert('快件单号不能为空');
				$('express_no').value='';
				$('express_no').focus();
				return false;
			}
            if (!trackCode){
				alert('验证码不能为空');
				$('trackCode').value='';
				$('trackCode').focus();
				return false;
			}
			exp_dlg_el.amongTo(window).setStyle('visibility','visible');
			_win.addEvent('resize',dlgAmong);    
			new Drag(exp_dlg_el,{handle:exp_dlg_el.getElement('.title').setStyle('cursor','move'),limit:{x:[0,_winSize.x-400],y:[0,5000]}});
			new Request.HTML({
					update:$E('#express_dialog #exp_query_result'),
					onRequest:function(){
						$E('#express_dialog #exp_query_result').set('text','正在查询...');
					},
					onFailure:function(){
						if(this.xhr.status == 501 && this.getHeader('notify_msg')){
							alert(decodeURIComponent(this.getHeader('notify_msg')));
						}
					}
				 }).get('index.php?ctl=action_express_manager&act=expressQuery&express_no='+expressNo+'&trackCode='+trackCode);
		});
	});

    $$('.goods_track .inputstyle').addEvent('focus',function(){
        if($(this).retrieve('showvcode',false))return;
        $('trackVerifyCodebox_<{$widgets_id}>').getElements('span').show();
        changeimg_<{$widgets_id}>();
        $(this).store('showvcode',true);
    });
    function changeimg_<{$widgets_id}>(){
        $('trackVerifyCode_<{$widgets_id}>').set('src','<{link ctl="passport" act="verifyCode" arg0="l"}>?'+$time());
    }

</script>